local MVPView = class("MVPView",function()
    return display.newLayer()
end)


function MVPView:ctor()
    --ui root
    self.playerPos = display.newNode()
    self:addChild(self.playerPos)
--    self.mUINode = cc.CSLoader:createNode(Res.BattleMVPScene,false,true)
    self.mUINode = MainBattleUICache:find(Res.BattleMVPScene)
    self.mUINode:setName("MVPScene")
    self.mUINode:setContentSize(cc.size(display.width,display.height))
    display.doLayout(self.mUINode)
    self:addChild(self.mUINode)
    self.panel = self.mUINode:findChild("Panel")
--    self.BGFriend = self.mUINode:findChild("Panel/Image_1")
--    self.BGEnemy = self.mUINode:findChild("Panel/Image_2")
    self.name = self.mUINode:findChild("Panel/name")
    --add init
    self:init()
end

function MVPView:init()
    
end

function MVPView:setData(name,bOurTeam,player)
    self.name:setString(name)
--    if bOurTeam then
--        self.BGFriend:setVisible(true)
--        self.BGEnemy:setVisible(false)
--    else
--        self.BGFriend:setVisible(false)
--        self.BGEnemy:setVisible(true)
--    end
    if bOurTeam then
        self.name:setTextColor(cc.c4b(99, 195, 226, 255))
    else
        self.name:setTextColor(cc.c4b(253, 103, 63, 255))
    end
    -- if player then
    --     player:retain()
    --     player:removeFromParent()
    --     self.playerPos:addChild(player)
    --     player:release()
    -- end
    --app:sendMsg("PvpController", "openWinView", {}, cb)
    display.playTimeline(self.mUINode)
end


return MVPView